home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / UI / CmdTable.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.9 KB  |  107 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CmdTable.h
  3.  
  4.     Contains:    Interface to CommandTable class
  5.  
  6.     Owned by:    Richard Rodseth
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>     5/25/95    jpa        List.h --> LinkList.h [1253324]
  13.          <2>     5/12/94    RR        include ODTypes.h
  14.          <1>     5/10/94    RR        first checked in
  15.          <3>      2/9/94    NP        Tiger Team cleanup.
  16.          <2>      2/7/94    NP        Tiger Team doings.
  17.          <1>     9/15/93    RR        first checked in
  18.  
  19.     To Do:
  20.     In Progress:
  21. */
  22.  
  23. #ifndef _CMDTABLE_
  24. #define _CMDTABLE_
  25.  
  26. #ifndef _ODTYPES_
  27. #include "ODTypes.h"
  28. #endif
  29.  
  30. #ifndef _PLFMDEF_
  31. #include "PlfmDef.h"
  32. #endif
  33.  
  34. #ifndef _LINKLIST_
  35. #include <LinkList.h>
  36. #endif
  37.  
  38. //==============================================================================
  39. // Theory of Operation
  40. //==============================================================================
  41.  
  42. /*
  43.     This class stores a mapping from menu/item to command number.
  44.     It's currently implemented using a linked list of triples, 
  45.     which may not be sufficiently sophisticated.
  46. */
  47.  
  48. //==============================================================================
  49. // Scalar Types
  50. //==============================================================================
  51.  
  52. //==============================================================================
  53. // Constants
  54. //==============================================================================
  55.  
  56. const ODCommandID kNoCommand = 0;
  57.  
  58. //=====================================================================================
  59. // Classes defined in this interface
  60. //=====================================================================================
  61.  
  62. class CommandTable;    
  63.  
  64. //=====================================================================================
  65. // Classes used by this interface
  66. //=====================================================================================
  67.  
  68. class LinkedList;
  69.  
  70. //=====================================================================================
  71. // Global Variables
  72. //=====================================================================================
  73.  
  74. //=====================================================================================
  75. // Class CommandTable
  76. //=====================================================================================
  77.  
  78. class CommandTable
  79. {
  80. public:
  81.  
  82.     CommandTable();
  83.     ODVMethod ~CommandTable();
  84.     
  85.     ODVMethod CommandTable* Copy();
  86.  
  87.     ODVMethod void    RegisterCommand(ODCommandID command,
  88.                                     ODMenuID menu,
  89.                                     ODMenuItemID menuItem);
  90.     
  91.     ODVMethod ODBoolean IsCommandRegistered(ODCommandID command);
  92.     
  93.     ODVMethod ODCommandID GetCommand(ODMenuID menu,
  94.                                     ODMenuItemID menuItem);
  95.     ODVMethod ODBoolean GetMenuAndItem(ODCommandID command,
  96.                                     ODMenuID& menu,
  97.                                     ODMenuItemID& menuItem);
  98.  
  99.     ODVMethod void UnregisterCommand(ODCommandID command);
  100.     ODVMethod void    UnregisterAll();            
  101.     
  102. private:
  103.  
  104.     LinkedList        fImplementation;
  105. };
  106.  
  107. #endif // _CMDTABLE_